package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.bo.FeedbackSubmitBo;
import com.cskaoyan.bean.entity.Feedback;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: project2_market
 * @time: 2021/10/22
 * @author: yangshuai
 **/

@RestController
@RequestMapping("wx/feedback")
public class WxFeedbackSubmit {

    @Autowired
    FeedbackService feedbackService;

    /**
     * 将反馈添加到数据库
     * @param feedback
     * @return
     */
    @RequestMapping("submit")
    public BaseRespVo submit(@RequestBody FeedbackSubmitBo feedback){

        Integer affected = feedbackService.insertFeedback(feedback);

        return BaseRespVo.ok(affected);

    }
}
